using System;
using System.Collections.Generic;
using System.Text;

using DataAccess;

namespace Task.Contracts
{
    /// <summary>
    /// Security task.
    /// Managing users.
    /// </summary>
    public interface ISecurityTask
    {
        /// <summary>
        /// Deletes the account.
        /// </summary>
        /// <param name="userId">The user id.</param>
        void DeleteAccount(int userId);

        /// <summary>
        /// Updates the user photo.
        /// </summary>
        /// <param name="u">The u.</param>
        /// <param name="photoBytes">The photo bytes.</param>
        /// <param name="mimeType">Type of the MIME.</param>
        /// <returns></returns>
        UserOperations UpdateUserPhoto(user u, byte[] photoBytes, string mimeType);

        /// <summary>
        /// Updates all user data.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        UserOperations UpdateAllUserDataWithPassword(user u);

        /// <summary>
        /// Updates all user data without password.
        /// </summary>
        /// <param name="u">The u.</param>
        /// <returns></returns>
        UserOperations UpdateAllUserDataWithoutPassword(user u);

        /// <summary>
        /// Gets the user by id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        user GetUserById(string id);

        /// <summary>
        /// Gets the user by email.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        user GetUserByEmail(string email);

        /// <summary>
        /// Gets the user by login.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        user GetUserByLogin(string login);

        /// <summary>
        /// Adds the new user.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        UserOperations AddNewUser(user u);

        /// <summary>
        /// Activates the user.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        UserOperations ActivateUser(user u);

        /// <summary>
        /// Generates the new password.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        UserOperations GenerateNewPassword(user u);
    }

    /// <summary>
    /// User Operations.
    /// </summary>
    public enum UserOperations
    {
        //login
        IncorrectPassword,
        IncorrectLogin,
        DisabledAccount,
        LoginSuccessfull,

        //adding
        UserAdded,
        LoginExists,
        EmailExists,

        //updating
        UserUpdated,

        //critical error
        CriticalError,

        //activate
        ActivateSuccesfull,
        ActivateFailed,
        AlredyActivated
    }
}
